﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyBlog.ServiceInterface;
using MyBlog.Model;
using MyBlog.Common;
using MyBlog.BusinessInterface;

namespace MyBlog.Service
{
    public class CategoryService : ICategoryService
    {
        IBusinessCategory _business;

        public CategoryService(IBusinessCategory business)
        {
            _business = business;
        }

        public void Add(CategoryModel entity)
        {
            _business.Add(entity);
        }

        public void Update(CategoryModel entity)
        {
            _business.Update(entity);
        }

        public void Delete(CategoryModel model)
        {
            _business.Delete(model);
        }

        public CategoryModel Get(CategoryModel model)
        {
            return _business.Get(model);
        }

        public List<CategoryModel> GetAll(bool isTracking = true)
        {
            return _business.GetAll(isTracking);
        }

        public List<CategoryModel> GetAll(CategoryModel model, bool isTracking = true)
        {
            return _business.GetAll(model, isTracking);
        }

        public void Delete(params object[] primaryKey)
        {
            _business.Delete(primaryKey);
        }
    }
}
